home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / toasterpaint / skeleton.rexx < prev    next >
OS/2 REXX Batch file  |  1995-12-27  |  4KB  |  146 lines

  1. /* Strobe.rexx -- Make a clip Processor */
  2. /* By Bob Caron © 1995 NewTek Inc.              */
  3.  
  4. parse arg InClipName","OutClipName","StartField","EndField
  5.  
  6. Address "DigiPaint"
  7. options results
  8.  
  9.  
  10. if InClipName="" & OutClipName="" then do
  11.  'Askb'"This only works;from process clip."
  12.  exit
  13.  end
  14.  
  15. 'AskuStart IFF Frame #'
  16. if RC = 5 then call quit("Canceled!")
  17. StartFrame=strtoint(Result)
  18.  
  19. IFFBaseName=OutClipName
  20.  
  21. if ~show('l','rexxsupport.library') then do
  22.   if ~addlib('rexxsupport.library',0,-30,34) then do
  23.     exit
  24.   end
  25. end
  26.  
  27. /* Reset Paint */
  28. 'Pmcl'
  29. 'Pot0' 0
  30. 'Pot1' 0
  31. 'Poth' $8000
  32. 'Potv' $8000
  33. 'Spoh' $8000
  34. 'Spov'
  35. /* End Of Reset*/
  36.  
  37. PageWide=752
  38. PageHigh=480
  39. dots=0
  40. XWin = 100
  41. YWin = 40
  42. Clear = d2c(12)
  43. nv = ''
  44. cr = '0a'x
  45. call getfontsize
  46.  
  47. wid = width*48
  48. hei = theight+height*10
  49.  
  50. if screen=0 then do
  51.    if ~open('Window','RAW:'XWin'/'YWin'/'wid'/'hei'/Strobe Script V2.0 - CTRL-C to Abort/NOSIZE/SCREEN 'ps,'W') then do
  52.        exit
  53.    end
  54. end
  55.  
  56. do Frame = StartField to (StartField+(EndField-StartField)/2)
  57.   if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  58.   if screen=0 then 'Gnfd'          /* Get the next field to process          */
  59.   call filter()                    /* Do The filter Thing...                 */
  60.   if screen=0 then 'Apfc'          /* Apeend the field to clip               */
  61.   if screen=0 then 'Gnfd'          /* Get the next field to process          */
  62.   if screen=0 then call filter()   /* If this is a flyer clip do other field */
  63.   if screen=0 then 'Apfc'          /* Apeend the field to clip               */
  64.   if screen=1 then 'Shco'          /* Render To Buffer (if this is screen processing)*/
  65.   end
  66. if screen=0 then 'Iclp'            /* Add an flyer icon to this clip */
  67. exit
  68.  
  69. filter:  /* Do a filter */
  70.  
  71. if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame) /* Update window and dots. */
  72.  
  73. /* Put paint filter code here */
  74.  
  75. return
  76.  
  77.  
  78. OpenWindow:
  79. parse arg InclipName,OutClipName,currentframe,EndFrame,Frame
  80.   pdots="...."
  81.   dots=dots+1
  82.   if dots>4 then dots=1
  83.   call writech('Window',Clear||nv||cr)
  84.   call writech('Window','Current Source Clip ['InClipName']'cr)
  85.   call writech('Window','  Current Dest Clip ['OutClipName']'cr)
  86.   call writech('Window',''cr)
  87.   call writech('Window','Current Frame: 'Frame/2''cr)
  88.   call writech('Window','    End Frame:'EndFrame/2''cr)
  89.   call writech('Window',''cr)
  90.   call writech('Window','Processing'right(pdots,dots)||cr)
  91.  
  92. return
  93.  
  94.  
  95. getfontsize:
  96.  
  97. if open('font','env:sys/font.prefs','R') then do
  98.    font = readch('font',word(statef('env:sys/font.prefs'),2))
  99.    call close('font')
  100.    font = substr(font,index(font,'FONT')+4)
  101.    font = substr(font,index(font,'FONT')+4)
  102.    height = c2d(substr(font,29,2))
  103.    tfont = substr(font,index(font,'FONT')+4)
  104.    theight = c2d(substr(tfont,29,2))
  105.    font = substr(font,33)
  106.    font = left(font,index(font,d2c(0))-1-5)
  107.    if open('font','FONTS:'font'/'height,'R') then do
  108.       width = c2d(right(readch('font',116),2))
  109.       call close('font')
  110.   end
  111.   else if height=9 then width = 10
  112.                    else width = 8
  113. end
  114.   else do
  115.   theight = 8
  116.   height = 8
  117.   width = 8
  118. end
  119.  
  120. return
  121.  
  122. strtoint:
  123. arg numb
  124.  
  125. numb=cleanline(numb)
  126. total=0
  127.  
  128. do x=1 to length(numb)
  129. total=total+(abs(48-c2d(substr(numb,(length(numb)+1)-x,1)))*(10**(x-1)))
  130. end
  131.  
  132. return total
  133.  
  134. cleanline: /* Remove a wudge of non-alpha char's  */
  135. parse arg line
  136. line=translate(line,"","/*=:.;:<>+-!@#$%^&*()_|\[]{}?~`,")
  137. line=translate(line,"","abcdefghijklmnopqrstuvwxyz")
  138. line=translate(line,"","ABCDEFGHIJKLMNOPQRSTUVWXUZ")
  139. line=translate(line,"",d2c(34))
  140. line=translate(line,"",d2c(40))
  141. line=translate(line,"",d2c(41))
  142. line=translate(line,"",d2c(0))
  143. line=compress(line)
  144. return line
  145.  
  146.